using zhwy.saas.api.Entity.Sys;

namespace zhwy.saas.api.Services.Sinterface.Sys
{
    /// <summary>
    /// 角色权限关联服务接口
    /// </summary>
    public interface ISysRolePermissionService : IBaseService<Roles_permissionsEntity>
    {
        /// <summary>
        /// 批量分配角色权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <param name="permissionIds">权限ID列表</param>
        /// <returns>是否分配成功</returns>
        Task<bool> AssignPermissionsAsync(int roleId, List<int> permissionIds);

        /// <summary>
        /// 移除角色的所有权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>是否移除成功</returns>
        Task<bool> RemoveRolePermissionsAsync(int roleId);

        /// <summary>
        /// 获取角色的权限ID列表
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns>权限ID列表</returns>
        Task<List<int>> GetPermissionIdsByRoleIdAsync(int roleId);

        /// <summary>
        /// 检查角色是否拥有指定权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <param name="permissionId">权限ID</param>
        /// <returns>是否拥有权限</returns>
        Task<bool> HasPermissionAsync(int roleId, int permissionId);
    }
}